products = [
    ("笔记本电脑", 5999, "电子"),
    ("Python编程书", 89, "图书"),
    ("无线鼠标", 159, "电子"),
    ("咖啡杯", 45, "生活")
]

def create_product_table_usd(products):
    # 汇率假设：1美元 = 7.2人民币
    exchange_rate = 7.2
    
    # 转换价格为美元并保留两位小数
    products_usd = []
    for name, price, category in products:
        price_usd = price / exchange_rate
        products_usd.append((name, price_usd, category))
    
    # 计算每列的最大宽度
    name_width = max(len(product[0]) for product in products_usd)
    
    # 价格宽度：考虑美元符号和小数点后两位
    price_width = max(len(f"${product[1]:.2f}") for product in products_usd)
    
    category_width = max(len(product[2]) for product in products_usd)
    
    # 表头
    header = f"{'产品名称':<{name_width}} | {'价格':>{price_width}} | {'分类':<{category_width}}"
    separator = "-" * len(header)
    
    # 构建表格
    table = [header, separator]
    
    for name, price, category in products_usd:
        price_formatted = f"${price:.2f}"
        row = f"{name:<{name_width}} | {price_formatted:>{price_width}} | {category:<{category_width}}"
        table.append(row)
    
    return "\n".join(table)

print("产品价格表(美元):")
print(create_product_table_usd(products))

# Output:产品价格表(美元):
# 产品名称      |      价格 | 分类
# ------------------------
# 笔记本电脑     | $833.19 | 电子
# Python编程书 |  $12.36 | 图书
# 无线鼠标      |  $22.08 | 电子
# 咖啡杯       |   $6.25 | 生活